<?php

namespace pmvc\ioc\annotation;

use pmvc\annotation\AbstractAnnotation;
use pmvc\ioc\PropertyDescriptor;

/**
 * TODO: document
 * 
 * @\pmvc\annotation\Params(names=["value", "type"])
 * @\pmvc\annotation\Locations(locations=[self::METHODS, self::PROPERTIES])
 */
class Property
	extends AbstractAnnotation {
		
	const STRING			= PropertyDescriptor::TYPE_STRING;
	const INTEGER			= PropertyDescriptor::TYPE_INTEGER;
	const FLOAT				= PropertyDescriptor::TYPE_FLOAT;
	const BOOLEAN			= PropertyDescriptor::TYPE_BOOLEAN;
	const JSON				= PropertyDescriptor::TYPE_JSON;
	const OBJECT			= PropertyDescriptor::TYPE_OBJECT;
	const ARRAY_OF_VALUES	= PropertyDescriptor::TYPE_ARRAY;
	const REF				= PropertyDescriptor::TYPE_REF;

	/**
	 * {@inheritDoc}
	 */
	protected function validateAndTransformParameter($name, $value) {
		switch($name) {
			case "type":
				return isset($value) ? $value : self::STRING;
			default:
				return $value;
		}
	}

}

?>